<template>
  <div class="box">
    <div class="mbox">
      <div class="sbox1">当前温度</div>
      <div class="sbox">{{ weatherStore?.weatherdata[0]?.tempMax }}℃</div>
    </div>
    <div class="mbox">
      <div class="sbox1">天气状况</div>
      <div class="sbox">{{ weatherStore?.weatherdata[0]?.textDay }}</div>
    </div>
    <div class="mbox">
      <div class="sbox1">气压</div>
      <div class="sbox">{{ weatherStore?.weatherdata[0]?.pressure }}hPa</div>
    </div>
    <div class="mbox">
      <div class="sbox1">风力风向</div>
      <div class="sbox">
        {{ weatherStore?.weatherdata[0]?.windDirDay }}&nbsp;{{
          weatherStore?.weatherdata[0]?.windScaleDay
        }}级
      </div>
    </div>
    <div class="mbox">
      <div class="sbox1">湿度</div>
      <div class="sbox">{{ weatherStore?.weatherdata[0]?.humidity }}%</div>
    </div>
    
    <div class="mbox">
      <div class="sbox1">紫外线强度指数</div>
      <div class="sbox">{{ weatherStore?.weatherdata[0]?.uvIndex }}级</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useWeatherStore } from '@/stores/weather'
const weatherStore = useWeatherStore()
</script>

<style scoped>
.box {
  width: 100%;
  height: 150px;
  font-size: 18px;
  align-items: center;
  justify-content: space-around;
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
  margin-bottom: 20px;
  .mbox {
    width: 33.3%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .sbox1 {
    margin: 10px 0;
    color: #77aaad;
  }
}
</style>
